package com.xy.test.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface TccStockService {
    @TwoPhaseBusinessAction(name = "reduceTcc", commitMethod = "reduceTccCommit", rollbackMethod = "reduceTccRollback")
    void reduceTcc(@BusinessActionContextParameter(paramName = "productId") Integer productId);

    boolean reduceTccCommit(BusinessActionContext context);

    boolean reduceTccRollback(BusinessActionContext context);

}